const { db } = require('../config')
const { command } = require('../config')
const { obd_collection } = require('../config')
exports.main = async (event, context) => {
    console.log(event)
    const data = event;
    const id = data.id;
    const region = data.region;
    const grid = data.grid;
    const res = await db.collection(obd_collection).doc(id).update({
        region: region,
        grid: grid
    });
    console.log(11111111,res)
    if (res.updated === 1) {
        return { code: 0, message: "更新成功", id: id };
    } else {
        return { code: 1, message: "更新失败", id: id };
    }
}